package client.serial;

import java.util.LinkedHashMap;

import com.google.gson.Gson;

public class MethodCallEntity {
    private String callInterface;
    private String methodName;
    private String returnType;
    private LinkedHashMap<String, Object> argList = new LinkedHashMap<String, Object>();
    
    public MethodCallEntity(String callInterface, String methodName,
            String returnType, Object[] args) {
        this.callInterface = callInterface;
        this.methodName = methodName;
        this.returnType = returnType;
        if(args != null && args.length!=0){
            for (Object object : args) {
                argList.put(object.getClass().getName(), object);
            }
        }
    }
    
    public String getMethodCall(){
        Gson gson = new Gson();
        return gson.toJson(this);
    }

    public String getCallInterface() {
        return callInterface;
    }

    public void setCallInterface(String callInterface) {
        this.callInterface = callInterface;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getReturnType() {
        return returnType;
    }

    public void setReturnType(String returnType) {
        this.returnType = returnType;
    }

    public LinkedHashMap<String, Object> getArgList() {
        return argList;
    }

    public void setArgList(LinkedHashMap<String, Object> argList) {
        this.argList = argList;
    }
}
